package com.yilife.hmstr.controller;

import com.yilife.hmstr.domain.ma;
import com.yilife.hmstr.service.impl.MeridianAnalysisServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/ma")
@Api(description = "经络分析数据的增删改查")
public class MeridianAnalysisController {
	
	@Autowired
	private MeridianAnalysisServiceImpl meridianAnalysisServiceImpl;
	
//	private int id=new Random().nextInt();
	
//	@RequestMapping("/add")
//	public void add(){
//		MeridianAnalysis ma=new MeridianAnalysis();
//		ma.setHmstrId(21322);
//		ma.setMaId(id);
//		ma.setSuggest("jianyi");
//		ma.setSymptom("symptom");
//		ma.setSymptomName("symptomName");
//		meridianAnalysisServiceImpl.add(ma);
//	}
//
	@RequestMapping(value = "/del",method = RequestMethod.DELETE)
	@ApiOperation(value = "根据健康管理系统检测报告id删除经络分析数据")
	public void del(@RequestBody Long hmstrId){
		meridianAnalysisServiceImpl.delByPid(hmstrId);
	}

//	public void update(){
//
//	}
//
	@RequestMapping(value = "/sel",method = RequestMethod.GET)
	@ApiOperation(value = "根据健康管理系统检测报告id查询经络分析数据")
	public ma select(@RequestParam Long hmstrId){
		return meridianAnalysisServiceImpl.selectByPid(hmstrId);
	}
}
